package com.tueye.utils;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import com.tueye.entity.Admin;

/**
 * 得到当前管理员登录的信息
 * @author hanxiaowei
 *
 */
public class BusinessDetailHelper {
	
	public static BusinessDetail getBusDetailInfo(HttpServletRequest request){
		BusinessDetail bd = new BusinessDetail();
		Admin admin = (Admin) request.getSession().getAttribute(TuEyeConstant.TUEYE_ADMIN);
		if(null!= admin){
			bd.setSys_username(admin.getUsername());
			bd.setSys_loginName(admin.getLoginName());
			bd.setSys_byname(admin.getByname());
			bd.setSys_password(admin.getPassword());
			bd.setSys_email(admin.getEmail());
			bd.setSys_isValid(admin.getIsValid());
			bd.setSys_time(admin.getSys_time());
			bd.setSys_time(new Date(System.currentTimeMillis()));
		}
		return bd;
	}
}
